Rendering content to a composition target

Use a Composition Target Render Pass to render content to a composition target.

Composition Target Render Pass automatically creates a texture from the content. You can use a Blit Render Pass to draw this texture to the screen or to another composition target using a specific material. To render content to a Render Target Texture, you can use the Render to Texture Pass. See Rendering to texture.

To render content to a composition target:

  1. In the Library > Rendering > Render Passes create a Group Render Pass.
    Group Render Pass allows you to collect render passes so that you can refer to a single render pass in your Scene or Viewport 2D node.
  2. In the Group Render Pass create a Composition Target Render Pass.
    Composition Target Render Pass renders itself and its child render passes to a composition target.
    The Composition Target Render Pass creates a composition target of the same size as the Viewport area of the Group Render Pass.
  3. In the Composition Target Render Pass create the render passes that render the content that you want to use.
    For example:
    1. Create a Default Render Pass.
      Default Render Pass creates a basic set of render passes that first render opaque nodes and then transparent nodes.
    2. In the Default Render Pass > Clear Render Pass add and set the Clear Color property.
      You clear the color buffer with the color you set in the Clear Color property and set the background color of the scene.
  4. In the Project select the Scene node the content of which you want to render to a composition target and in the Properties set the Render Pass property to the Group Render Pass you created in the first step.
    Kanzi now renders the Scene using the render passes you created. Kanzi renders the content to a composition target which is why you do not see the content in the Preview.
  5. To draw the composition target to the screen with a specific material use a Blit Render Pass.
    For example, in the Group Render Pass create a Blit Render Pass and in the Properties set:

  6. (Optional) If you do not set the Composition Target property, you can set these properties in the Composition Target Render Pass:

See also

Rendering

Using Kanzi Studio render pass templates

Rendering multiple render passes or textures

Creating mipmaps for a composition target

Using multisampling

Tutorial: Create a Gaussian blur effect

Tutorial: Create a bloom effect